﻿<%@ Import Namespace="APMS.WebSite.Models.DataStore" %>

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Main.Master" AutoEventWireup="true" 
    CodeBehind="List.aspx.cs" Inherits="APMS.WebSite.Views.Project.List" %>

<asp:Content ID="ScriptContent" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="PageTitleContent" ContentPlaceHolderID="PageTitleHolder" runat="server">
    <h2 class="nodesc">Project List</h2>
    <p class="desc">Select any project to proceed</p>
</asp:Content>
<asp:Content ID="NavigationMenuContent" ContentPlaceHolderID="NavigationMenuHolder" runat="server">
</asp:Content>
<asp:Content ID="CommandLinkContent" ContentPlaceHolderID="CommandLinkHolder" runat="server">
</asp:Content>
<asp:Content ID="SidebarContent" ContentPlaceHolderID="SidebarHolder" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="ContentHolder" runat="server">
    <%
        List<Project> selectedProjects = ViewData[ProjectController.PROJECTS_FOR_USER] as List<Project>;
        if ((selectedProjects != null) && (selectedProjects.Count > 0))
        {
    %>
        <ul>
        <% foreach (Project project in ViewData[ProjectController.PROJECTS_FOR_USER] as List<Project>)
           { %>
            <li>
                <%=Html.ActionLink(project.ProjectName, "Overview", "Project", new { id = project.ProjectID })%>
            </li>
        <% } %>
        </ul>
    <%  } else { %>
        <p>You are currently not involve in any project, choose one of the projects to get started in <%=Html.ActionLink<UserController>(x => x.Update(APMS.WebSite.Common.UserProfile.UserName), "your profile")%></p>
    <%} %>
 
   
</asp:Content>
